﻿<UserControl x:Class="Clancy.Ui.Controls.TeachThresholdControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:design="clr-namespace:Clancy.Ui.ViewModels.Design"
             mc:Ignorable="d" 
             d:DataContext="{d:DesignInstance design:TeachThresholdViewModelMock, IsDesignTimeCreatable=True}"
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <DockPanel>

            <StackPanel Orientation="Horizontal" DockPanel.Dock="Top">
                <Button Content="Start learning" Command="{Binding CmdStartLearn}" Margin="2" />
                <Button Content="Stop learning" Command="{Binding CmdStopLearn}" Margin="2"/>
            </StackPanel>

            <Grid DockPanel.Dock="Top">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>

                <Label Grid.Column="0" Grid.Row="0" Content="Average silence level" />
                <Label Grid.Column="0" Grid.Row="1" Content="Average activity level" />
                <Label Grid.Column="0" Grid.Row="2" Content="Estimated threshold level" />

                <Label Grid.Column="1" Grid.Row="0" Content="{Binding AverageSilenceLevel}" />
                <Label Grid.Column="1" Grid.Row="1" Content="{Binding AverageActivityLevel}" />
                <Label Grid.Column="1" Grid.Row="2" Content="{Binding EstimatedThresholdLevel}" />

                <Button Grid.Column="2" Grid.Row="0" Content="Start" Command="{Binding CmdStartTeachSilence}" Margin="2" />
                <Button Grid.Column="2" Grid.Row="1" Content="Start" Command="{Binding CmdStartTeachActivity}" Margin="2" />

                <Button Grid.Column="3" Grid.Row="0" Content="Stop" Command="{Binding CmdStopTeachSilence}" Margin="2" />
                <Button Grid.Column="3" Grid.Row="1" Content="Stop" Command="{Binding CmdStopTeachActivity}" Margin="2" />
            </Grid>

            <StackPanel>
                <Button Content="Reset" Command="{Binding CmdResetTeaching}" Margin="2" />
                <Button Content="Commit" Command="{Binding CmdCommit}" Margin="2"/>
            </StackPanel>

        </DockPanel>
    </Grid>
</UserControl>
